<table width="100%" border="0" cellspacing="1" cellpadding="0" class="table table-bordered table-hover table-striped">
  <tr class="infos">
    <td width="18%" height="33" align="center" valign="middle">学号</td>
    <td width="21%" align="center" valign="middle">姓名</td>
    <td width="17%" align="center" valign="middle">
    	<label for="isby_main"><input type="checkbox" name="by_main" id="isby_main" /><a id="status_main">是否毕业</a></label>
    </td>
    <td width="23%" align="center" valign="middle">毕业信息</td>
    <td width="21%" align="center" valign="middle">个人信息</td>
  </tr>
  <volist name="oneDetail" id="vo">
  <tr>
    <td height="30" align="center" valign="middle"><{$vo.sid}></td>
    <td align="center" valign="middle"><{$vo.name}>&nbsp;</td>
    <td align="center" valign="middle"><input type="checkbox" name="by_sub" id="isby_sub" value="<{$vo.index}>" <{$vo.isby}>/><a title="<{$vo.sid}>" name="status">毕业</a>&nbsp;
    </td>
    <td align="center" valign="middle"><a name="editorDetail" title="<{$vo.sid}>">编辑详细信息</a></td>
    <td align="center" valign="middle"><a name="oneDetail" title="<{$vo.sid}>">查看个人信息</a></td>
  </tr>
</volist>
</table>
<div id="bys_model_window">
    <iframe id="bys_model_content" src="<{:U('Editor/dealByDetail')}>" frameborder="0" scrolling="no"></iframe>
    <button id="bys_model_close">×</button>
</div>
<script>
    var isby_main=document.getElementById("isby_main");
    var status_main=document.getElementById("status_main");
    var close=document.getElementById("bys_model_close");
    var bys_model_window=document.getElementById("bys_model_window");
    var bys_model_content=document.getElementById("bys_model_content");
    var oneDetail=document.getElementsByName("oneDetail");
    var bys=new PureAjax();
    var isby_sub=document.getElementsByName("by_sub");
    var status=document.getElementsByName("status");
    var editorDetail=document.getElementsByName("editorDetail");
    isby_main.onclick=function(){
        for(var z=0;z<isby_sub.length;z++){
            isby_sub[z].checked=this.checked;
        }
        var is2=this.checked;
        bys.post({
                dataType:"text",
                async:true,
                data:{sid:"all",getgrade:"<{$oneDetail[0]['grade']}>",getmajor:"<{$oneDetail[0]['major']}>",getclass:"<{$oneDetail[0]['class']}>",is:is2},
                url:URL+"Request/dealBy",
                success:function(data){
                    var sta=document.createElement("font");
                    if(data=="success"){
                        sta.color="green";
                        sta.innerHTML+=" √";
                        status_main.appendChild(sta);
                    }else{
                        sta.color="red";
                        sta.innerHTML+=" ×";
                        status_main.appendChild(sta);
                    }
                }
            });
    }
    for(z=0;z<isby_sub.length;z++){

        isby_sub[z].onclick=function(){
            var index=this.value;
            var is1=this.checked;
            bys.post({
                dataType:"text",
                data:{sid:status[index].title,is:is1},
                url:"/student/index.php/Request/dealBy",
                success:function(data){
                    var sta=document.createElement("font");
                    if(data=="success"){
                        sta.color="green";
                        sta.innerHTML+=" √";
                        status[index].appendChild(sta);
                    }else{
                        sta.color="red";
                        sta.innerHTML+=" ×";
                        status[index].appendChild(sta);
                    }
                }
            });
        }
    }
    for(z=0;z<oneDetail.length;z++){
        oneDetail[z].onclick=function(){
            var sid=this.title;
            showDetail(sid);
            return false;
        }
    }
    var sum=0;
    for(z=0;z<isby_sub.length;z++){
        if(isby_sub[z].checked){
            sum++;
        }
    }
    if(sum==isby_sub.length){
        isby_main.checked=true;
    }
    for(z=0;z<editorDetail.length;z++){
        editorDetail[z].onclick=function(){
            var insid=this.title;
            var tmp=bys_model_content.src.split(".");
            var src=new Array();
            src[0]=tmp[0]+"."+tmp[1];
            src[1]=tmp[2];
            bys_model_content.src=src[0]+"/sid/"+insid+"."+src[1];
            var bwidth=document.body.offsetWidth;
            var wwidth=450;
            bys_model_window.style.left=((bwidth/2)-(wwidth/2))+"px";
            bys_model_window.style.display="block";
        }
    }
    close.onclick=function(){
        bys_model_window.style.display="none";
    }
</script>